package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusClinderGateMapper;
import com.ruoyi.business.domain.BusClinderGate;
import com.ruoyi.business.service.IBusClinderGateService;
import javax.annotation.Resource;

/**
 * 缸闸井台账Service业务层处理
 * 
 * @author oyh
 * @date 2024-07-15
 */
@Service
public class BusClinderGateServiceImpl implements IBusClinderGateService 
{
    @Resource
    private BusClinderGateMapper busClinderGateMapper;

    /**
     * 查询缸闸井台账
     * 
     * @param id 缸闸井台账主键
     * @return 缸闸井台账
     */
    @Override
    public BusClinderGate selectBusClinderGateById(Long id)
    {
        return busClinderGateMapper.selectBusClinderGateById(id);
    }

    /**
     * 查询缸闸井台账列表
     * 
     * @param busClinderGate 缸闸井台账
     * @return 缸闸井台账
     */
    @Override
    public List<BusClinderGate> selectBusClinderGateList(BusClinderGate busClinderGate)
    {
        return busClinderGateMapper.selectBusClinderGateList(busClinderGate);
    }

    /**
     * 新增缸闸井台账
     * 
     * @param busClinderGate 缸闸井台账
     * @return 结果
     */
    @Override
    public int insertBusClinderGate(BusClinderGate busClinderGate)
    {
        busClinderGate.setCreateUser(SecurityUtils.getUserId());
        busClinderGate.setCreateBy(SecurityUtils.getUsername());
        busClinderGate.setCreateTime(DateUtils.getNowDate());
        busClinderGate.setUpdateUser(SecurityUtils.getUserId());
        busClinderGate.setUpdateBy(SecurityUtils.getUsername());
        busClinderGate.setUpdateTime(DateUtils.getNowDate());
        return busClinderGateMapper.insertBusClinderGate(busClinderGate);
    }

    /**
     * 修改缸闸井台账
     * 
     * @param busClinderGate 缸闸井台账
     * @return 结果
     */
    @Override
    public int updateBusClinderGate(BusClinderGate busClinderGate)
    {
        busClinderGate.setUpdateUser(SecurityUtils.getUserId());
        busClinderGate.setUpdateBy(SecurityUtils.getUsername());
        busClinderGate.setUpdateTime(DateUtils.getNowDate());
        return busClinderGateMapper.updateBusClinderGate(busClinderGate);
    }

    /**
     * 批量删除缸闸井台账
     * 
     * @param ids 需要删除的缸闸井台账主键
     * @return 结果
     */
    @Override
    public int deleteBusClinderGateByIds(Long[] ids)
    {
        return busClinderGateMapper.deleteBusClinderGateByIds(ids);
    }

    /**
     * 删除缸闸井台账信息
     * 
     * @param id 缸闸井台账主键
     * @return 结果
     */
    @Override
    public int deleteBusClinderGateById(Long id)
    {
        return busClinderGateMapper.deleteBusClinderGateById(id);
    }

    @Override
    public Integer getCylinderCount() {
        return busClinderGateMapper.getCylinderCount();
    }

    @Override
    public Integer getLockWellCount() {
        return busClinderGateMapper.getLockWellCount();
    }
}
